package com.ygp.lang;

import java.util.ArrayList;
import java.util.List;

/**
 * <Description> <br>
 *
 * @author linmiaolai@sanyygp.com<br>
 * @version 1.0<br>
 * @date 2021/10/11 <br>
 */
public class ListTest {
    public static void main(String[] args) {
        List<Integer> result = new ArrayList<>();
        result.add(2);
        result.add(3);
        result.add(4);
        result.add(5);
        result.add(6);
        result.add(7);
        int size = result.size();
        int splitIndex = size / 2;
        List<Integer> left = result.subList(0, splitIndex);
        System.out.println(left);
        List<Integer> right = result.subList(splitIndex, size);
        System.out.println(right);
    }
}
